12 point(const int &X
, const int &Y
) : x(X
), y(Y
) {}
18 line(const int &A
, const int &B
) : a(A
), b(B
) {}
22 //Returns positive if p is to the left of line l
23 //Returns negative if p is to the right of line l
24 //Returns zero if p is colineal with line l
25 int cross(const point
&p
, const line
&l
){
30 return (p
.x
*q
.y
- q
.x
*p
.y
);
33 bool check(const vector
<point
> &c
, const line
&l
){
34 int left
= 0, right
= 0;
35 for (int i
=0; i
<2*n
; ++i
){
36 int t
= cross(c
[i
], l
);
40 return (left
== n
&& right
== n
);
45 while (cin
>> n
&& n
){
46 vector
<point
> cherry(2*n
);
47 for (int i
=0; i
<2*n
; ++i
){
48 cin
>> cherry
[i
].x
>> cherry
[i
].y
;
52 for (int i
=-500; i
<=500 && !found
; ++i
){
53 for (int j
=-500; j
<=500 && !found
; ++j
){
54 if (check(cherry
, line(i
, j
))){
55 cout
<< i
<< " " << j
<< endl
;